<template>
  <div id="bg">
    <div id="el-login">
      <h1>欢迎来到尔玉管理平台</h1>
      <img src="/imgs/logo/logo.png" style="width: 60px" alt="">
      <el-tabs type="border-card"
               style="width: 400px;
                      height: 500px;
                      margin: 0 auto;
                      background-color:rgba(255,255,255,0.3)">
        <el-tab-pane label="快速注册账号">
          <!--            label-width设置每个表单项 文本标签的宽度-->
          <el-form  :model="ruleForm" :rules="rules" ref="ruleForm"  class="demo-ruleForm"
              style="width: 300px;margin: 20px auto" label-width="80px">
            <el-form-item label="用户名" style="color: black;">
              <el-input type="text" placeholder="请输入用户名" v-model="ruleForm.adminname"></el-input>
            </el-form-item>
            <el-form-item label="用户密码" style="color: black">
              <el-input type="text" placeholder="请输入用户密码" v-model="ruleForm.password"></el-input>
            </el-form-item>
            <el-form-item label="确认密码" style="color: black">
              <el-input type="text" placeholder="请再次输入用户密码" v-model="ruleForm.repassword"></el-input>
            </el-form-item>
            <el-form-item label="邮箱地址" style="color: black">
              <el-input type="text" placeholder="请输入邮箱地址" v-model="ruleForm.email"></el-input>
            </el-form-item>
            <el-form-item label="用户昵称" style="color: black">
              <el-input type="text" placeholder="请输入用户昵称" v-model="ruleForm.adminnick"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button style="position: relative;right: 30px" type="primary">登录</el-button>
            </el-form-item>
          </el-form>
          <a href="AdminLoginView.vue" style="text-decoration: none;color: #3a8ee6;text-align: center">已有账号，去登录</a>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        adminname: '',
        password:"",
        repassword:"",
        email:"",
        adminnick:"",
        delivery: false,
      },
      rules: {
        adminname: [
          { required: true, trigger: 'blur' },
          { min: 4, max: 16, message: '长度在 4 到 16 个字符', trigger: 'blur' }
        ],
        password:[
          { required: true,  trigger: 'blur' },
          { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
        ],
        repassword:[
          { required: true,  trigger: 'blur' },
          { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
        ],
        email:[
          { required: true,  trigger: 'blur' },
          { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
        ],
        adminnick:[
          { required: true,  trigger: 'blur' },
          { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
        ],
      }
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert('submit!');
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
}
</script>

<style scoped>
#bg {
  background-repeat: no-repeat;
background-image: url("/src/views/admin/bg01.png");
  background-size: 70%;
  background-position: center;
  background-color: black;
  margin: 0;
  overflow: hidden;
}

#el-login {
  color: #3a8ee6;
  width: 500px;
  height: 675px;
  margin-left: 950px;
  margin-top: 20px;

}

</style>